using SimpleJSON;

namespace Gj
{
    public class DataHelper : NodeHelper
    {
        public BindDataType dataType = BindDataType.None;
        public Notice notice;

        protected override BindDataType bindDataType => dataType;

        protected override void BindData(string s)
        {
            if (notice != null) notice.SetData(s);
        }

        protected override void BindData(int i)
        {
            if (notice != null) notice.SetData(i);
        }

        protected override void BindData(bool b)
        {
            if (notice != null) notice.SetData(b);
        }

        protected override void BindData(float f)
        {
            if (notice != null) notice.SetData(f);
        }

        protected override void BindData(JSONObject json)
        {
            if (notice != null) notice.SetData(json);
        }

        protected override void BindData(JSONArray array)
        {
            if (notice != null) notice.SetData(array);
        }

        public interface Notice
        {
            void SetData(string s);
            void SetData(int i);
            void SetData(bool b);
            void SetData(float f);
            void SetData(JSONObject obj);
            void SetData(JSONArray arr);
        }
    }
}